home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3032 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: zetnet.co.uk!demon!stsdaveb.demon.co.uk
  2. From: dave@stsdaveb.demon.co.uk (Dave Thornton)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Check for dll
  5. Date: Thu, 25 Jan 1996 16:48:15 GMT
  6. Organization: Severn Trent Systems
  7. Message-ID: <3107b1f8.9170223@news.demon.co.uk>
  8. References: <3106341E.1B00@ubs.ch>
  9. NNTP-Posting-Host: stsdaveb.demon.co.uk
  10. X-NNTP-Posting-Host: stsdaveb.demon.co.uk
  11. X-Newsreader: Forte Agent .99c/16.141
  12.  
  13. On Wed, 24 Jan 1996 14:29:02 +0100, Daniel Ponti <daniel.ponti@ubs.ch>
  14. wrote:
  15.  
  16. >Is there a possibility to check for a specific dll in the memory?
  17. >I have not found a windows api function. There is only one to free
  18. >a dll by its handler (FreeLibrary) and one to load a dll
  19. >(LoadLibrary) but no one for check a dll already in the memory.
  20. >
  21. >Thanks for any hints
  22. >Daniel
  23.  
  24. Daniel
  25. There are two windows functions ModuleFirst() and ModuleNext() both
  26. take an ME structure as a parameter. These functions walk down the
  27. Windows module list returning all modules loaded in memory ie EXE's
  28. DLL's, Driver's font's  etc. 
  29.  
  30. Within the MEstructure are such things as usage count, handle of
  31. module, module name and module exepath. The exepath contains the full
  32. pathname of where the module came from ie myapp.dll.
  33.  
  34. Its use is very akin to the DosFindFirst() and DosFindNext()
  35. functions used in dos to read files on disk. 
  36. If you want the source of the code I wrote as an excersise in seeing
  37. what modules where loaded then email me directly. 
  38.  
  39. Regards 
  40.  
  41.  
  42. -------------------------------------------------------------------------------
  43. | Dave Thornton    | email dave@stsdaveb.demon.co.uk                          |
  44. | Staffs, England  |                                                          |
  45. -------------------------------------------------------------------------------
  46.